package deng.jboss.examples.mdb;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.EJB;
import javax.ejb.MessageDriven;
import javax.jms.Message;
import javax.jms.MessageListener;

import org.jboss.metamodel.descriptor.ServiceRefDelegate.DummyServiceRef;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import deng.jboss.examples.slsb.DummyService;


/**
 * @author Zemian Deng
 *
 */

@MessageDriven(
	messageListenerInterface = MessageListener.class,
	activationConfig = { 
		@ActivationConfigProperty(propertyName = "destination", propertyValue = "/queue/ExampleQueue"),
		@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
	}
)
public class CallSLSBMsgBean implements MessageListener {
	private static Logger logger = LoggerFactory.getLogger(CallSLSBMsgBean.class);
	
	@EJB
	private DummyService dummyService;
	
	@Override
    public void onMessage(Message message) {
		logger.debug("Received message: " + message);
		logger.debug("Invoking dummyService: " + dummyService);
    }
}
